import request from '@/config/axios'
import type { RoomHistory } from './types'

export const getRoomHistoryListApi = (params: any): Promise<IResponse<IResData<RoomHistory>>> => {
  return request.get({ url: '/room-history', params })
}

export const updateRoomHistoryApi = (
  id: string,
  data: Partial<RoomHistory>
): Promise<IResponse> => {
  return request.put({ url: `/room-history/id/${id}`, data })
}

export const getRoomHistoryDetailApi = (id: string): Promise<IResponse<RoomHistory>> => {
  return request.get({ url: `/room-history/id/${id}` })
}

export const delRoomHistoryListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/room-history/id/${ids[0]}` })
}
